﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteNoRequireLogin.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TranTekBE.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

            <div id="login" style="margin-top: 60px; position: relative; border: 1px solid #ccc; padding: 20px;">
                <asp:Label ID="lbErr" runat="server"></asp:Label>
                <asp:Literal ID="ltLoginErr" runat="server" />
                <asp:Literal ID="ltUserNameErr" runat="server" />
                <asp:Literal ID="ltPasswordErr" runat="server" />
                <div>
                    <h3 style="background-color: #ccc; padding: 5px">Người Dùng Đăng Nhập</h3>
                    <div style="float: left; margin-top: 20px; position: absolute">
                        <span style="margin-right: 5px">Tên người dùng:</span><asp:TextBox ID="txtUserName" runat="server" Width="200px" />
                    </div>
                    <br />
                    <div style="float: left; margin-top: 40px; position: absolute">
                        <span style="margin-right: 50px">Mật khẩu:</span><asp:TextBox ID="txtPassword" runat="server" Width="200px" TextMode="Password" />
                    </div>
                    <br />
                    <div style="margin-top: 60px; margin-bottom: 10px;">
                        <asp:Button ID="btnLogin" runat="server" Text="Đăng nhập" OnClick="btnLogin_Click" Width="100px" />
                    </div>
                </div>
            </div>

        </ContentTemplate>
    </asp:UpdatePanel>









    <script type="text/javascript">
        $(document).ready(function () {
            $("#header").css('margin-top', -60 + 'px');
            $("#header").css('width', 154 + '%');
        });


        function LoadJS() {

            ip = null;
            //$.getJSON("http://jsonip.appspot.com?callback=?",
            //http://myip.mattnordhoff.com/json
            $.getJSON("http://jsonip.com/",
              function (data) {
                  ip = data.ip;
                  //  $("#getip").val(ip)
                  //  alert(ip); //return ip address correctly

                  $.ajax({
                      type: "POST",
                      url: "/Admin/Service.aspx?ip=" + ip,
                      contentType: "application/json; charset=utf-8",
                      data: "{}",
                      dataType: "json"
                  });

                  //alert(ip); //return ip address correctly
              });

        }

    </script>
</asp:Content>
